//
//  UILabel+WSQFontAdapter.m
//  AFNetworking
//
//  Created by 翁胜琼 on 2019/2/17.
//

#import "UILabel+WSQFontAdapter.h"

@implementation UILabel (WSQFontAdapter)

- (float)adapterWidthFontSize
{
    return self.font.pointSize;
}

- (void)setAdapterWidthFontSize:(float)adapterWidthFontSize
{
    if (adapterWidthFontSize > 0)
    {
        self.font = [self.font fontWithSize:adapterWidthFontSize * [self sq_getScreenScale]];
    }else
    {
        self.font = self.font;
    }
}

- (float)adapterHeightFontSize
{
    return self.font.pointSize;
}

- (void)setAdapterHeightFontSize:(float)adapterHeightFontSize
{
    if (adapterHeightFontSize > 0)
    {
        self.font = [self.font fontWithSize:adapterHeightFontSize * [self sq_getScreenDcale]];
    }else
    {
        self.font = self.font;
    }
}

- (CGFloat)sq_getScreenScale
{
    CGFloat scale = [UIScreen mainScreen].bounds.size.width / 375;
    return scale;
}

- (CGFloat)sq_getScreenDcale
{
    CGFloat scale = [UIScreen mainScreen].bounds.size.height / 667;
    return scale;
}

@end
